package com.googlecode.transmutant

@Step(order=1)
class TimeStep1 {
	
	@Out(name="mosdef")
	def mosdef
	
	@Step
	void steppy() {
		mosdef = "mosdef"
	}
}

@Step(order=2)
class TimeStep2 {

	def mosdef
	
	@Step
	void steppy(@In(name="mosdef") mosdef) {
		this.mosdef = mosdef
	}
}

class SimpleStep  {
	def pork
	
	@Step
	void step() {
		pork = "dork"
	}
}

class SubclassStep extends SimpleStep{
	@Step(order=1)
	void step2It() {
		pork += "mork"
	}
}

class MethodOutStep {
	@Step
	@Out(name="spam") String stepOut(){
		return "dingDong"
	}
}


class OutStep {
	@Out(name="")
	def pork = ""
	
	@Out(name="smorky")
	def smork = "ing"
	
	@Out(name="spam")
	def spam = "spammified"
	
	@Step
	void step() {
		pork = "pig"
	}
}

class InStep  {
	@In(name="")
	def pork = ""
	
	@In(name="smorky")
	def smork = ""
	
	def smorking = "smork"
	
	def spam = ""
	
	@Step
	void step() {
		pork += "mouth"
		smorking += smork
	}
	
	@Step
	void stepWithParam(@In(name="spam") spam) {
		this.spam = spam
	}
}

class TwoStep  {
	def string = ""
	
	@Step(order = 2)
	void step2() {
		string += "step2"
	}
	
	@Step(order = 1)
	void step1() {
		string += "step1"
	}
}

class ThreeStep  {
	def string = ""
	
	@Step(order = 2)
	void step2() {
		string += "step2"
	}
	
	@Step(order = 5)
	void step5() {
		string += "step5"
	}
	
	@Step(order = 1)
	void step1() {
		string += "step1"
	}
}

class ThreeStepSame  {
	def string = ""
	
	@Step(order = 1)
	void step2() {
		string += "step2"
	}
	
	@Step(order = 5)
	void step5() {
		string += "step5"
	}
	
	@Step(order = 1)
	void step1() {
		string += "step1"
	}
}

class NullInsStep  {
	@In(name="nilly")
	def nilly
	@Out(name="nully")
	def nully
	
	@Step(order = 1)
	@Out(name="nelly")
	String fritatta(@In(name="nally") String foo, String bar) {
		return null
	}
}

class MultiInFieldStep  {
	@In(name="nilly")
	def polly
	
	@In(name="nilly")
	def nilly
}

class MultiOutFieldStep  {
	@Out(name="milly")
	def sally
	
	@Out(name="milly")
	def silly
}

class OutFieldWithOutStepOfSameName  {
	@Out(name="milly")
	def sally

	@Out(name="milly") @Step String eat() {
		return null
	}
	
}